A state of emergency has been declared in New York City as the remnants of Hurricane Ida sweep through the region.